#!/bin/bash
set -e
CONTENTS="$(cd "$(dirname "$0")/.." && pwd)"
RUNNER="$CONTENTS/Resources/Start.command"
# Finder uses a restricted PATH; open a visible Terminal for setup and job logs.
# Passing the path as argv and using quoted form protects spaces/apostrophes.
exec /usr/bin/osascript - "$RUNNER" <<'APPLESCRIPT'
on run argv
    set runner to item 1 of argv
    tell application "Terminal"
        activate
        do script "/bin/bash " & quoted form of runner
    end tell
end run
APPLESCRIPT
